// NMI's Java Code Viewer 6.0a
// www.trinnion.com/javacodeviewer

// Registered to Evaluation Copy                                      
// Generated PGFZKD AyTB 14 2007 15:43:34 

//source File Name:   KLine.java

package com.chiyou.common.indicator;

//import gnnt.MEBS.HQApplet.*;

// Referenced classes of package gnnt.MEBS.HQApplet.Indicator:
//            IndicatorBase, IndicatorPos

public class KLine extends IndicatorBase {

	public static final int LineType_K = 0;
	public static final int LineType_USA = 1;
	public static final int LineType_POLY = 2;
	int m_iLineType;

	public KLine(IndicatorPos pos, int iLineType, int Precision) {
		super(pos, Precision);
		super.m_strIndicatorName = "KLine";
		m_iLineType = iLineType;
	}

	public void Calculate() {
	}

	protected void GetMaxMin() {
		if (super.m_pos.m_Begin > super.m_pos.m_End) {
			super.m_max = 0.0F;
			super.m_min = 0.0F;
			return;
		}
		super.m_max = 0.0F;
		super.m_min = 1E+008F;
		for (int i = super.m_pos.m_Begin; i <= super.m_pos.m_End; i++)
			if (m_iLineType == 0 || m_iLineType == 1) {
				if (super.m_kData[i].getHighPrice() > 0.0F) {
					if (super.m_kData[i].getHighPrice() > super.m_max)
						super.m_max = super.m_kData[i].getHighPrice();
					if (super.m_kData[i].getLowPrice() < super.m_min)
						super.m_min = super.m_kData[i].getLowPrice();
				}
			} else if (super.m_kData[i].getClosePrice() > 0.0F) {
				if (super.m_kData[i].getClosePrice() > super.m_max)
					super.m_max = super.m_kData[i].getClosePrice();
				if (super.m_kData[i].getClosePrice() < super.m_min)
					super.m_min = super.m_kData[i].getClosePrice();
			}

	}


	@Override
	public int isBuyOrSell() {
		// TODO Auto-generated method stub
		return 0;
	}
}
